3.1.25 \(\int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n (A+B \sin (e+f x)+C \sin ^2(e+f x)) \, dx\) [25]

3.1.25.1 Optimal result
3.1.25.2 Mathematica [F]
3.1.25.3 Rubi [A] (verified)
3.1.25.4 Maple [F]
3.1.25.5 Fricas [F]
3.1.25.6 Sympy [F(-1)]
3.1.25.7 Maxima [F]
3.1.25.8 Giac [F]
3.1.25.9 Mupad [F(-1)]

3.1.25.1 Optimal result

Integrand size = 45, antiderivative size = 383 \[ \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right ) \, dx=-\frac {C \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^{1+n}}{d f (2+m+n)}+\frac {\sqrt {2} (c (C+2 C m)+d (C (1-m+n)+A (2+m+n)-B (2+m+n))) \operatorname {AppellF1}\left (\frac {1}{2}+m,\frac {1}{2},-n,\frac {3}{2}+m,\frac {1}{2} (1+\sin (e+f x)),-\frac {d (1+\sin (e+f x))}{c-d}\right ) \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n}}{d f (1+2 m) (2+m+n) \sqrt {1-\sin (e+f x)}}-\frac {\sqrt {2} (c C (1+m)-d (C m+B (2+m+n))) \operatorname {AppellF1}\left (\frac {3}{2}+m,\frac {1}{2},-n,\frac {5}{2}+m,\frac {1}{2} (1+\sin (e+f x)),-\frac {d (1+\sin (e+f x))}{c-d}\right ) \cos (e+f x) (a+a \sin (e+f x))^{1+m} (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n}}{a d f (3+2 m) (2+m+n) \sqrt {1-\sin (e+f x)}} \]

output
-C*cos(f*x+e)*(a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^(1+n)/d/f/(2+m+n)+(c*(2* 
C*m+C)+d*(C*(1-m+n)+A*(2+m+n)-B*(2+m+n)))*AppellF1(1/2+m,-n,1/2,3/2+m,-d*( 
1+sin(f*x+e))/(c-d),1/2+1/2*sin(f*x+e))*cos(f*x+e)*(a+a*sin(f*x+e))^m*(c+d 
*sin(f*x+e))^n*2^(1/2)/d/f/(1+2*m)/(2+m+n)/(((c+d*sin(f*x+e))/(c-d))^n)/(1 
-sin(f*x+e))^(1/2)-(c*C*(1+m)-d*(C*m+B*(2+m+n)))*AppellF1(3/2+m,-n,1/2,5/2 
+m,-d*(1+sin(f*x+e))/(c-d),1/2+1/2*sin(f*x+e))*cos(f*x+e)*(a+a*sin(f*x+e)) 
^(1+m)*(c+d*sin(f*x+e))^n*2^(1/2)/a/d/f/(3+2*m)/(2+m+n)/(((c+d*sin(f*x+e)) 
/(c-d))^n)/(1-sin(f*x+e))^(1/2)
 
3.1.25.2 Mathematica [F]

\[ \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right ) \, dx=\int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right ) \, dx \]

input
Integrate[(a + a*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^n*(A + B*Sin[e + f*x 
] + C*Sin[e + f*x]^2),x]
 
output
Integrate[(a + a*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^n*(A + B*Sin[e + f*x 
] + C*Sin[e + f*x]^2), x]
 
3.1.25.3 Rubi [A] (verified)

Time = 1.17 (sec) , antiderivative size = 410, normalized size of antiderivative = 1.07, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3042, 3524, 3042, 3466, 3042, 3267, 157, 27, 156, 155}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (a \sin (e+f x)+a)^m \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right ) (c+d \sin (e+f x))^n \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a \sin (e+f x)+a)^m \left (A+B \sin (e+f x)+C \sin (e+f x)^2\right ) (c+d \sin (e+f x))^ndx\)

\(\Big \downarrow \) 3524

\(\displaystyle \frac {\int (\sin (e+f x) a+a)^m (c+d \sin (e+f x))^n (a (A d (m+n+2)+C (n d+d+c m))+a (C d m-c C (m+1)+B d (m+n+2)) \sin (e+f x))dx}{a d (m+n+2)}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int (\sin (e+f x) a+a)^m (c+d \sin (e+f x))^n (a (A d (m+n+2)+C (n d+d+c m))+a (C d m-c C (m+1)+B d (m+n+2)) \sin (e+f x))dx}{a d (m+n+2)}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)}\)

\(\Big \downarrow \) 3466

\(\displaystyle \frac {(B d (m+n+2)-c C (m+1)+C d m) \int (\sin (e+f x) a+a)^{m+1} (c+d \sin (e+f x))^ndx-a (-A d (m+n+2)+B d (m+n+2)-C (c m+d n+d)-c C (m+1)+C d m) \int (\sin (e+f x) a+a)^m (c+d \sin (e+f x))^ndx}{a d (m+n+2)}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(B d (m+n+2)-c C (m+1)+C d m) \int (\sin (e+f x) a+a)^{m+1} (c+d \sin (e+f x))^ndx-a (-A d (m+n+2)+B d (m+n+2)-C (c m+d n+d)-c C (m+1)+C d m) \int (\sin (e+f x) a+a)^m (c+d \sin (e+f x))^ndx}{a d (m+n+2)}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)}\)

\(\Big \downarrow \) 3267

\(\displaystyle \frac {\frac {a^2 \cos (e+f x) (B d (m+n+2)-c C (m+1)+C d m) \int \frac {(\sin (e+f x) a+a)^{m+\frac {1}{2}} (c+d \sin (e+f x))^n}{\sqrt {a-a \sin (e+f x)}}d\sin (e+f x)}{f \sqrt {a-a \sin (e+f x)} \sqrt {a \sin (e+f x)+a}}-\frac {a^3 \cos (e+f x) (-A d (m+n+2)+B d (m+n+2)-C (c m+d n+d)-c C (m+1)+C d m) \int \frac {(\sin (e+f x) a+a)^{m-\frac {1}{2}} (c+d \sin (e+f x))^n}{\sqrt {a-a \sin (e+f x)}}d\sin (e+f x)}{f \sqrt {a-a \sin (e+f x)} \sqrt {a \sin (e+f x)+a}}}{a d (m+n+2)}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)}\)

\(\Big \downarrow \) 157

\(\displaystyle \frac {\frac {a^2 \sqrt {1-\sin (e+f x)} \cos (e+f x) (B d (m+n+2)-c C (m+1)+C d m) \int \frac {\sqrt {2} (\sin (e+f x) a+a)^{m+\frac {1}{2}} (c+d \sin (e+f x))^n}{\sqrt {1-\sin (e+f x)}}d\sin (e+f x)}{\sqrt {2} f (a-a \sin (e+f x)) \sqrt {a \sin (e+f x)+a}}-\frac {a^3 \sqrt {1-\sin (e+f x)} \cos (e+f x) (-A d (m+n+2)+B d (m+n+2)-C (c m+d n+d)-c C (m+1)+C d m) \int \frac {\sqrt {2} (\sin (e+f x) a+a)^{m-\frac {1}{2}} (c+d \sin (e+f x))^n}{\sqrt {1-\sin (e+f x)}}d\sin (e+f x)}{\sqrt {2} f (a-a \sin (e+f x)) \sqrt {a \sin (e+f x)+a}}}{a d (m+n+2)}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {a^2 \sqrt {1-\sin (e+f x)} \cos (e+f x) (B d (m+n+2)-c C (m+1)+C d m) \int \frac {(\sin (e+f x) a+a)^{m+\frac {1}{2}} (c+d \sin (e+f x))^n}{\sqrt {1-\sin (e+f x)}}d\sin (e+f x)}{f (a-a \sin (e+f x)) \sqrt {a \sin (e+f x)+a}}-\frac {a^3 \sqrt {1-\sin (e+f x)} \cos (e+f x) (-A d (m+n+2)+B d (m+n+2)-C (c m+d n+d)-c C (m+1)+C d m) \int \frac {(\sin (e+f x) a+a)^{m-\frac {1}{2}} (c+d \sin (e+f x))^n}{\sqrt {1-\sin (e+f x)}}d\sin (e+f x)}{f (a-a \sin (e+f x)) \sqrt {a \sin (e+f x)+a}}}{a d (m+n+2)}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)}\)

\(\Big \downarrow \) 156

\(\displaystyle \frac {\frac {a^2 \sqrt {1-\sin (e+f x)} \cos (e+f x) (B d (m+n+2)-c C (m+1)+C d m) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n} \int \frac {(\sin (e+f x) a+a)^{m+\frac {1}{2}} \left (\frac {c}{c-d}+\frac {d \sin (e+f x)}{c-d}\right )^n}{\sqrt {1-\sin (e+f x)}}d\sin (e+f x)}{f (a-a \sin (e+f x)) \sqrt {a \sin (e+f x)+a}}-\frac {a^3 \sqrt {1-\sin (e+f x)} \cos (e+f x) (-A d (m+n+2)+B d (m+n+2)-C (c m+d n+d)-c C (m+1)+C d m) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n} \int \frac {(\sin (e+f x) a+a)^{m-\frac {1}{2}} \left (\frac {c}{c-d}+\frac {d \sin (e+f x)}{c-d}\right )^n}{\sqrt {1-\sin (e+f x)}}d\sin (e+f x)}{f (a-a \sin (e+f x)) \sqrt {a \sin (e+f x)+a}}}{a d (m+n+2)}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)}\)

\(\Big \downarrow \) 155

\(\displaystyle \frac {\frac {\sqrt {2} a \sqrt {1-\sin (e+f x)} \cos (e+f x) (a \sin (e+f x)+a)^{m+1} (B d (m+n+2)-c C (m+1)+C d m) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n} \operatorname {AppellF1}\left (m+\frac {3}{2},\frac {1}{2},-n,m+\frac {5}{2},\frac {1}{2} (\sin (e+f x)+1),-\frac {d (\sin (e+f x)+1)}{c-d}\right )}{f (2 m+3) (a-a \sin (e+f x))}-\frac {\sqrt {2} a^2 \sqrt {1-\sin (e+f x)} \cos (e+f x) (a \sin (e+f x)+a)^m (-A d (m+n+2)+B d (m+n+2)-C (c m+d n+d)-c C (m+1)+C d m) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n} \operatorname {AppellF1}\left (m+\frac {1}{2},\frac {1}{2},-n,m+\frac {3}{2},\frac {1}{2} (\sin (e+f x)+1),-\frac {d (\sin (e+f x)+1)}{c-d}\right )}{f (2 m+1) (a-a \sin (e+f x))}}{a d (m+n+2)}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)}\)

input
Int[(a + a*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^n*(A + B*Sin[e + f*x] + C* 
Sin[e + f*x]^2),x]
 
output
-((C*Cos[e + f*x]*(a + a*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^(1 + n))/(d* 
f*(2 + m + n))) + (-((Sqrt[2]*a^2*(C*d*m - c*C*(1 + m) - A*d*(2 + m + n) + 
 B*d*(2 + m + n) - C*(d + c*m + d*n))*AppellF1[1/2 + m, 1/2, -n, 3/2 + m, 
(1 + Sin[e + f*x])/2, -((d*(1 + Sin[e + f*x]))/(c - d))]*Cos[e + f*x]*Sqrt 
[1 - Sin[e + f*x]]*(a + a*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^n)/(f*(1 + 
2*m)*(a - a*Sin[e + f*x])*((c + d*Sin[e + f*x])/(c - d))^n)) + (Sqrt[2]*a* 
(C*d*m - c*C*(1 + m) + B*d*(2 + m + n))*AppellF1[3/2 + m, 1/2, -n, 5/2 + m 
, (1 + Sin[e + f*x])/2, -((d*(1 + Sin[e + f*x]))/(c - d))]*Cos[e + f*x]*Sq 
rt[1 - Sin[e + f*x]]*(a + a*Sin[e + f*x])^(1 + m)*(c + d*Sin[e + f*x])^n)/ 
(f*(3 + 2*m)*(a - a*Sin[e + f*x])*((c + d*Sin[e + f*x])/(c - d))^n))/(a*d* 
(2 + m + n))
 

3.1.25.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 155
Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_)) 
^(p_), x_] :> Simp[((a + b*x)^(m + 1)/(b*(m + 1)*Simplify[b/(b*c - a*d)]^n* 
Simplify[b/(b*e - a*f)]^p))*AppellF1[m + 1, -n, -p, m + 2, (-d)*((a + b*x)/ 
(b*c - a*d)), (-f)*((a + b*x)/(b*e - a*f))], x] /; FreeQ[{a, b, c, d, e, f, 
 m, n, p}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] &&  !IntegerQ[p] && GtQ[Sim 
plify[b/(b*c - a*d)], 0] && GtQ[Simplify[b/(b*e - a*f)], 0] &&  !(GtQ[Simpl 
ify[d/(d*a - c*b)], 0] && GtQ[Simplify[d/(d*e - c*f)], 0] && SimplerQ[c + d 
*x, a + b*x]) &&  !(GtQ[Simplify[f/(f*a - e*b)], 0] && GtQ[Simplify[f/(f*c 
- e*d)], 0] && SimplerQ[e + f*x, a + b*x])
 

rule 156
Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_)) 
^(p_), x_] :> Simp[(e + f*x)^FracPart[p]/(Simplify[b/(b*e - a*f)]^IntPart[p 
]*(b*((e + f*x)/(b*e - a*f)))^FracPart[p])   Int[(a + b*x)^m*(c + d*x)^n*Si 
mp[b*(e/(b*e - a*f)) + b*f*(x/(b*e - a*f)), x]^p, x], x] /; FreeQ[{a, b, c, 
 d, e, f, m, n, p}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] &&  !IntegerQ[p] & 
& GtQ[Simplify[b/(b*c - a*d)], 0] &&  !GtQ[Simplify[b/(b*e - a*f)], 0]
 

rule 157
Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_)) 
^(p_), x_] :> Simp[(c + d*x)^FracPart[n]/(Simplify[b/(b*c - a*d)]^IntPart[n 
]*(b*((c + d*x)/(b*c - a*d)))^FracPart[n])   Int[(a + b*x)^m*Simp[b*(c/(b*c 
 - a*d)) + b*d*(x/(b*c - a*d)), x]^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, 
 d, e, f, m, n, p}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] &&  !IntegerQ[p] & 
&  !GtQ[Simplify[b/(b*c - a*d)], 0] &&  !SimplerQ[c + d*x, a + b*x] &&  !Si 
mplerQ[e + f*x, a + b*x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3267
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + ( 
f_.)*(x_)])^(n_.), x_Symbol] :> Simp[a^2*(Cos[e + f*x]/(f*Sqrt[a + b*Sin[e 
+ f*x]]*Sqrt[a - b*Sin[e + f*x]]))   Subst[Int[(a + b*x)^(m - 1/2)*((c + d* 
x)^n/Sqrt[a - b*x]), x], x, Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m 
, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && 
 !IntegerQ[m]
 

rule 3466
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + 
 (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si 
mp[(A*b - a*B)/b   Int[(a + b*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^n, x], x 
] + Simp[B/b   Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ 
[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && NeQ[A*b + a*B, 0]
 

rule 3524
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + 
 (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_. 
) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*(a + b*Sin[e + f*x] 
)^m*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(m + n + 2))), x] + Simp[1/(b*d*(m + 
 n + 2))   Int[(a + b*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^n*Simp[A*b*d*(m 
+ n + 2) + C*(a*c*m + b*d*(n + 1)) + (C*(a*d*m - b*c*(m + 1)) + b*B*d*(m + 
n + 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m, n} 
, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] &&  !Lt 
Q[m, -2^(-1)] && NeQ[m + n + 2, 0]
 
3.1.25.4 Maple [F]

\[\int \left (a +a \sin \left (f x +e \right )\right )^{m} \left (c +d \sin \left (f x +e \right )\right )^{n} \left (A +B \sin \left (f x +e \right )+C \left (\sin ^{2}\left (f x +e \right )\right )\right )d x\]

input
int((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^n*(A+B*sin(f*x+e)+C*sin(f*x+e)^2), 
x)
 
output
int((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^n*(A+B*sin(f*x+e)+C*sin(f*x+e)^2), 
x)
 
3.1.25.5 Fricas [F]

\[ \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right ) \, dx=\int { {\left (C \sin \left (f x + e\right )^{2} + B \sin \left (f x + e\right ) + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} \,d x } \]

input
integrate((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^n*(A+B*sin(f*x+e)+C*sin(f*x+ 
e)^2),x, algorithm="fricas")
 
output
integral(-(C*cos(f*x + e)^2 - B*sin(f*x + e) - A - C)*(a*sin(f*x + e) + a) 
^m*(d*sin(f*x + e) + c)^n, x)
 
3.1.25.6 Sympy [F(-1)]

Timed out. \[ \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right ) \, dx=\text {Timed out} \]

input
integrate((a+a*sin(f*x+e))**m*(c+d*sin(f*x+e))**n*(A+B*sin(f*x+e)+C*sin(f* 
x+e)**2),x)
 
output
Timed out
 
3.1.25.7 Maxima [F]

\[ \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right ) \, dx=\int { {\left (C \sin \left (f x + e\right )^{2} + B \sin \left (f x + e\right ) + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} \,d x } \]

input
integrate((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^n*(A+B*sin(f*x+e)+C*sin(f*x+ 
e)^2),x, algorithm="maxima")
 
output
integrate((C*sin(f*x + e)^2 + B*sin(f*x + e) + A)*(a*sin(f*x + e) + a)^m*( 
d*sin(f*x + e) + c)^n, x)
 
3.1.25.8 Giac [F]

\[ \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right ) \, dx=\int { {\left (C \sin \left (f x + e\right )^{2} + B \sin \left (f x + e\right ) + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} \,d x } \]

input
integrate((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^n*(A+B*sin(f*x+e)+C*sin(f*x+ 
e)^2),x, algorithm="giac")
 
output
integrate((C*sin(f*x + e)^2 + B*sin(f*x + e) + A)*(a*sin(f*x + e) + a)^m*( 
d*sin(f*x + e) + c)^n, x)
 
3.1.25.9 Mupad [F(-1)]

Timed out. \[ \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (A+B \sin (e+f x)+C \sin ^2(e+f x)\right ) \, dx=\int {\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,{\left (c+d\,\sin \left (e+f\,x\right )\right )}^n\,\left (C\,{\sin \left (e+f\,x\right )}^2+B\,\sin \left (e+f\,x\right )+A\right ) \,d x \]

input
int((a + a*sin(e + f*x))^m*(c + d*sin(e + f*x))^n*(A + B*sin(e + f*x) + C* 
sin(e + f*x)^2),x)
 
output
int((a + a*sin(e + f*x))^m*(c + d*sin(e + f*x))^n*(A + B*sin(e + f*x) + C* 
sin(e + f*x)^2), x)